import http from '../http';

export const delApi = (id) =>
    http({
        url: '/route/delete',
        method: 'POST',
        data: {
            id
        }
    })

export const addApi = (data) => http({
    url: "/route/insert",
    method: "post",
    data
})

export const XzApi = (id) =>
    http({
        url: '/visit/exportPart',
        method: 'POST',
        data: {
            id
        }
    })

export const QbApi = (id) =>
    http({
        url: '/visit/exportAll',
        method: 'POST',
        data: {
            id
        }
    })

export const ExportApi = () => http({
    url: '/visit/exportAll',
    method: 'post',
    responseType: 'arraybuffer'

});

export const ExpordutApi = (id) => {
    console.log(id);
    return http({
        url: '/visit/exportPart',
        method: 'post',
        responseType: 'arraybuffer',
        data: {
            id
        }
    });
}

export const Exportall2Api = () => http({
    url: "/visit/exportAll2",
    method: 'post',
    responseType: 'arraybuffer',
})

export const Exportpart2Api = (id) => http({
    url: "/visit/exportPart2",
    method: 'post',
    responseType: 'arraybuffer',
    params: {
        id
    }
})

export const selectByName = (formInline) => {
    console.log(formInline)
    return http({
        url: '/route/selectByName',
        method: 'POST',
        params: {
            brandName: formInline.region,
            routeName: formInline.user
        }
    })
}

export const BaichaApi = (formInline) => {
    console.log(formInline)
    return http({
        url: '/visit/selectByName',
        method: 'POST',
        params: {
            contactPerson: formInline.user,
            name: formInline.region
        }
    })
}

export const ShangcApi = (formInline) => {
    console.log(formInline)
    return http({
        url: '/uploadManage/selectByName',
        method: 'POST',
        params: {
            name: formInline.user,
            person: formInline.region
        }
    })
}

export const BftApi = (formInline) => {
    console.log(formInline)
    return http({
        url: '/visit/selectByName2',
        method: 'POST',
        params: {
            name: formInline.user,
            person: formInline.region,
            type: formInline.kehu,
            effectiveTime: formInline.youxiao,
            visitTime: formInline.cishu,
        }
    })
}


